const app = getApp();
const scdxParse = require('../../scdxParse/scdxParse.js');

// pages/webView/webView.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    title: '',
    author: ''
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    const _this = this;
    const curPro = app.globalData.projections[options.pIdx];
    this.setData({
      title: curPro.title,
      author: curPro.author
    });
    this.parse = scdxParse({
      html: curPro.content,
      page: _this
    });
  },

  /**
   * 生命周期函数-监听页面卸载
   */
  onUnload () {
    this.parse.clear();
  }
});